//
//  Emotition.swift
//  表情栏
//
//  Created by Dengdwd on 15/10/21.
//  Copyright © 2015年 dwd. All rights reserved.
//

import UIKit

class Emotition: NSObject {

    var code: String? {
        didSet{
        let scanner = NSScanner(string: code!)
        var value:UInt32 = 0
        scanner.scanHexInt(&value)
        emoji = String(Character(UnicodeScalar(value)))
            
        }
    }
    var chs:String?
    var png:String?
    var imagePath:String {
        return png != nil ? NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png! : ""
    }
    var emoji:String?
    init(dict:[String:String]) {
        super.init()

        setValuesForKeysWithDictionary(dict)
    }
    
    var times = 0
    
    var isRemove:Bool = false
    init(isRemove:Bool){
        super.init()
        self.isRemove = isRemove
    }
    
    var isEmpty:Bool = false
    init(isEmpty:Bool){
        super.init()
        self.isEmpty = isEmpty
    }
    
    
    override var description:String {
    let keys = ["code","chs","png"]
        return dictionaryWithValuesForKeys(keys).description
    
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
}
